package Installer::CommandCreator;

use JIP::ToolSet; # load my commonly-used modules in a single import
use parent qw( FactoryMethod );

use Carp qw( croak );
use English qw( -no_match_vars );

sub create {
    my $class   = shift;
    my $request = shift;

    my $location    = 'Installer/Command/'. $request .'.pm';
    my $fabricClass = 'Installer::Command::'. $request;

    my $requireStatus = $class->_isRequireError( $location );

    croak( "tried to require '". $fabricClass ."': ". $requireStatus )
        if $requireStatus;

    require $location;

    my $fabricObject = $fabricClass->new( @ARG );

    return $fabricObject;
}

1;
